const {ccclass, property} = cc._decorator;

@ccclass
export default class BirdControl extends cc.Component {

    onLoad() {
        // 物理引擎开启
        cc.director.getPhysicsManager().enabled = true;
    }

    start() {

    }

    // 飞
    fly() {
        this.getComponent(cc.RigidBody).linearVelocity = cc.v2(0, 100);
    }

    update(dt) {

    }

    onBeginContact(contact, self, other) {
        if (other.tag == 1) {
            console.log("加分")
        } else {
            console.log("死亡")
        }
    }
}
